<%@ page import="com.edu.imau.IC_CARD.IC" %>
<%@ page import="com.edu.imau.ParkingDao" %><%--
  Created by IntelliJ IDEA.
  User: 卢佳瑄
  Date: 2022/12/29
  Time: 12:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>IC管理信息界面</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- Bootstrap core CSS -->
    <link href="bootstrap-3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="navbar-fixed-top/navbar-fixed-top.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.13.1/datatables.min.css"/>
</head>
<body>

<form class="form-inline" action="ICadd">
    <input type="hidden" name="card_id" value="${ic.card_id}">
    <div class="form-group">
        <label class="sr-only" style="width: 120px">IC卡号</label>
        <input type="text" class="form-control" name="card_code" id="card_code" placeholder="IC卡号"
               style="width: 250px" value="${ic.card_code}">
    </div>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">车位编号</label>
        <input type="text" class="form-control" name="seat_number" id="seat_number" placeholder="车位编号"
               style="width: 200px" value="${ic.seat_number}">
    </div>
    <div class="form-group">
        <label class="sr-only" style="width: 50px">用户姓名</label>
        <input type="text" class="form-control" name="name" id="name" placeholder="用户姓名" style="width: 100px"
               value="${ic.name}">
    </div>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">用户性别</label>
        <input type="text" class="form-control" name="gender" id="gender" placeholder="用户性别" style="width: 100px"
               value="${ic.gender}">
    </div>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">车牌号</label>
        <input type="text" class="form-control" name="car_number" id="car_number" placeholder="车牌号"
               style="width: 150px" value="${ic.car_number}">
    </div>
    </div>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">用户住址</label>
        <input type="text" class="form-control" name="user_addr" id="user_addr" placeholder="用户住址"
               style="width: 300px" value="${ic.user_addr}">
    </div>
    <button type="submit" class="btn btn-default" href="icmanager.jsp">确定</button>
</form>
<hr>

<table id="example" class="table table-bordered table-hover">
    <thead>
    <th>序号</th>
    <th>IC卡号</th>
    <th>车位编号</th>
    <th>用户姓名</th>
    <th>用户性别</th>
    <th>车牌号</th>
    <th>用户住址</th>
    <th>操作</th>
    </thead>
    <tbody>
    <%Object list = request.getAttribute("icdata2");%>
    <%for (IC ic : new ParkingDao().getICAll()) {%>
    <tr>
        <td><%= ic.getCard_id() %>
        </td>
        <td><%= ic.getCard_code() %>
        </td>
        <td><%= ic.getSeat_number() %>
        </td>
        <td><%= ic.getName() %>
        </td>
        <td><%= ic.getGender() %>
        </td>
        <td><%= ic.getCar_number() %>
        </td>
        <td><%= ic.getUser_addr() %>
        </td>
        <td>
            <a class="btn btn-warning" href="ICupdate?card_id=<%= ic.getCard_id() %>" role="button">修改</a>
            <a class="btn btn-danger" href="ICdelete?card_id=<%= ic.getCard_id() %>" role="button">删除</a>
        </td>
    </tr>
    <%}%>
    </tbody>
</table>
</body>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
        crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.13.1/datatables.min.js"></script>
<script>
    $(document).ready(function () {
        $('#example').DataTable();
    });
</script>
</html>